package club.justwill.single.model;

/**
 * Created by xiangnan on 15-12-23.
 */
public class UserType {
    public static int ANONYMOUS = 0;
    public static int INDIVIDUAL = 10;
    public static int BUSINESS = 20;
    public static int SYSTEM = 30;
    public static int ADMINISTRATOR = 40;

    public static String getUserType(int type) {
        switch(type) {
            case 0 : return "ANONYMOUS";
            case 10 : return "INDIVIDUAL";
            case 20 : return "BUSINESS";
            case 30 : return "SYSTEM";
            case 40 : return "ADMINISTRATOR";
            default: return null;
        }
    }

    public static int getUserTypeCode(String type) {
        if(type.equals("ANONYMOUS")) { return 0;}
        if(type.equals("INDIVIDUAL")) { return 10;}
        if(type.equals("BUSINESS")) { return 20;}
        if(type.equals("SYSTEM")) { return 30;}
        if(type.equals("ADMINISTRATOR")) { return 40;}
        return 0;
    }
}
